package com.shengyuan.manage_os.adapter;

import android.content.Context;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import com.shengyuan.manage_os.R;

import java.util.List;

/**
 * Created by Administrator on 2016/11/19.
 */

public class GridViewAdapter extends BaseAdapter {
    private List<Bitmap> data;
    private Context context;
    public GridViewAdapter(List<Bitmap> data,Context context) {
        this.data = data;
        this.context = context;
    }

    @Override
    public int getCount() {
        return data.size();
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }
    ImageView imageView;
    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {

        view = LayoutInflater.from(context).inflate(R.layout.grid_item_image,null);
        imageView = (ImageView) view.findViewById(R.id.image);
        imageView.setImageBitmap(data.get(i));
        System.out.println("@@@@@@@@@===="+data.size()+"===@@@@@@@@==="+data.get(i));
        return view;
    }
}
